﻿/*
 * Copyright © 2020, Wuxi Safover Intelligent Technology Co., Ltd. All rights reserved.
 * 
 * 无锡安永智能科技有限公司版权所有，未经许可，不得用于商业用途
 * 
 * Visit: https://www.safover.com/ 
 */

using System;

namespace Safover.LidarCollector.Core
{
    internal abstract class BaseRotaryTableController : BaseDeviceController, IRotaryTableDeviceControllable
    {
        public abstract RotaryTableStatus RotaryTableStatus { get; }

        public virtual bool CanOpen => false;

        public virtual bool CanClose => false;

        public virtual bool CanOperate => false;

        protected RotaryTableDevice Device { get; }

        public BaseRotaryTableController(RotaryTableDevice device)
        {
            Device = device ?? throw new ArgumentNullException("device");
        }

        public virtual bool TryOpen()
        {
            HandleInvalidOperation();
            return false;
        }

        public virtual bool TryClose()
        {
            HandleInvalidOperation();
            return false;
        }

        public virtual bool TryMoveHorizontally(float angle)
        {
            HandleInvalidOperation();
            return false;
        }

        public virtual bool TryMoveVertically(float angle)
        {
            HandleInvalidOperation();
            return false;
        }


        public virtual bool TryRestoreZero()
        {
            HandleInvalidOperation();
            return false;
        }

        protected void SetStatus(RotaryTableStatus status)
        {
            Device.SetStatus(status);
        }

    }


}
